package com.zhangc.blog.admin.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhangc.blog.admin.entity.ArticleEntity;
import com.zhangc.blog.admin.mapper.ArticleMapper;

/**
 * 功能描述:<br>
 *
 * @author wx:fdzhangc
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
@Service
public class ArticleService {
    @Autowired
    ArticleMapper articleMapper;

    public boolean publishArticle(ArticleEntity article) {
        int res = articleMapper.insertArticle(article);
        return res > 0;
    }

    public ArticleEntity getArticleById(Long id) {
        return articleMapper.getArticleById(id);
    }
}
